﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 类_多态_重写_
{
    class Program
    {
        static void Main(string[] args)
        {
            /*Dog dog = new Dog();
            dog.Shut();
            
            Cat cat = new Cat();
            cat.Shut();*/

            //定义一个数组
            /* Animal[] animals =
             {
                 new Cat(),
                 new Dog(),
             };
             foreach (var item in animals)
             {
                 item.Shut();
             }*/

            Test(new Cat());
            Test(new Dog());
        }

        static void Test(Animal animal)
        {
            animal.Shut();
        }
    } 
}
